<?
$sub_menu = "700100";
include_once("./_common.php");

auth_check($auth[$sub_menu], "r");

$token = get_token();

$g4[title] = "방문일지 관리";
include_once("./admin.head.php");

$sql = "SELECT	*
		FROM	visit_record
		WHERE	id = '$id'";
$rst = sql_query($sql);
$view = mysql_fetch_assoc($rst);

$store_num = $view['vi_area'];
$this_year = date("Y");
$sql2 = "SELECT		y{$this_year}
		 FROM		month_avg
		 WHERE		store_num = '$store_num'";
$rst2 = sql_query($sql2);
$view2 = mysql_fetch_assoc($rst2);
$this_str = $view2["y".$this_year];
$vi_month = explode("|", $this_str);
?>
<style>
div.title_wrap1 {margin-top:30px;}
div.title_wrap1 h3 {width:160px;text-align:center;margin:0 auto; font-family:"맑은 고딕";color:#fff; padding:7px 0px; background-color:#5970a4;}
div.table1 {font-family:'맑은 고딕'}
div.table1 p {text-align:left;margin:5px 0;}
table.info1 {border:2px solid #5970a4;width:98%;}
table.info1 tr {height:40px;border-top:1px solid #d9d9d9;}
table.info1 th {border-top:1px solid #fff;xborder-right:1px solid #fff;background-color:#5970a4; xfont-weight:normal; text-align:left; padding-left:5px;height:39px; color:#fff;}
table.info1 td {border-top:1px solid #ccc;border-right:1px solid #ccc;border-left:1px solid #ccc;text-align:left;padding-left:10px;}
div.table2 {}
table.info2 {border:2px solid #5970a4;width:98%; margin-top:20px;}
table.info2 tr {height:40px;border-top:1px solid #d9d9d9;}
table.info2 th {border-top:1px solid #fff;xborder-right:1px solid #fff;background-color:#5970a4; xfont-weight:normal; text-align:left; padding-left:5px;height:39px; color:#fff;}
table.info2 td {border-top:1px solid #ccc;border-right:1px solid #ccc;border-left:1px solid #ccc;text-align:left;padding-left:10px;}
.txtwd {width:95%}
.tareawd {width:96%}
div.table2 p {text-align:right}
</style>
<div class="wrap" >
	<div class="title_wrap1">
		<h3>방 문 일 지</h3>
	</div>
	<div class="table1">
		<p>No. : <?php echo $view['vi_no']?></p>
		<table class="info1" border=0 cellspacing=0 cellpadding=0>
		<colgroup>
		<col width="180px" />
		<col width="" />
		</colgroup>
		<tr>
		<th>방문일자</th>
		<td><?php echo $view['vi_date']?></td>
		</tr>
		<tr>
		<th>구분</th>
		<td><?php echo $view['vi_flag']?></td>
		</tr>
		<tr>
		<th>방문자</th>
		<td><?php echo $view['vi_name1']?></td>
		</tr>
		<tr>
		<th>방문시간</th>
		<td><?php echo $view['vi_time']?></td>
		</tr>
		</table>
	</div>
	<div class="table2">
		<table class="info2" border=0 cellspacing=0 cellpadding=0>
		<colgroup>
		<col width="180px" />
		<col width="" />
		</colgroup>
		<tr>
		<th>점명</th>
		<td><?php echo $view['vi_store']?>
		</td>
		</tr>
		<tr>
		<th>점주명</th>
		<td><?php echo $view['vi_name2']?></td>
		</tr>
		<tr>
		<th>직원수</th>
		<td><?php echo $view['vi_count']?></td>
		</tr>
		<tr>
		<th>평균고객수</th>
		<td><?php echo $view['vi_avg']?></td>
		</tr>
		<tr>
		<th>금일매출현황</th>
		<td><?php echo $view['vi_sales']?></td>
		</tr>
		<tr>
		<th>월 평균 매출</th>
		<td>
			<?php if($vi_month['0'] != "") { ?>
				1월 <?php echo $vi_month['0']?><br />
			<? } ?>
			<?php if($vi_month['1'] != "") { ?>
				2월 <?php echo $vi_month['1']?><br />
			<? } ?>
			<?php if($vi_month['2'] != "") { ?>
				3월 <?php echo $vi_month['2']?><br />
			<? } ?>
			<?php if($vi_month['3'] != "") { ?>
				4월 <?php echo $vi_month['3']?><br />
			<? } ?>
			<?php if($vi_month['4'] != "") { ?>
				5월 <?php echo $vi_month['4']?><br />
			<? } ?>
			<?php if($vi_month['5'] != "") { ?>
				6월 <?php echo $vi_month['5']?><br />
			<? } ?>
			<?php if($vi_month['6'] != "") { ?>
				7월 <?php echo $vi_month['6']?><br />
			<? } ?>
			<?php if($vi_month['7'] != "") { ?>
				8월 <?php echo $vi_month['7']?><br />
			<? } ?>
			<?php if($vi_month['8'] != "") { ?>
				9월 <?php echo $vi_month['8']?><br />
			<? } ?>
			<?php if($vi_month['9'] != "") { ?>
				10월 <?php echo $vi_month['9']?><br />
			<? } ?>
			<?php if($vi_month['10'] != "") { ?>
				11월 <?php echo $vi_month['10']?><br />
			<? } ?>
			<?php if($vi_month['11'] != "") { ?>
				12월 <?php echo $vi_month['11']?>
			<? } ?>
		</td>
		</tr>
		<tr>
		<th>이벤트현황</th>
		<td><?php echo $view['vi_event']?></td>
		</tr>
		<tr>
		<th>홀 유지 관리상태</th>
		<td><?php if($view['vi_hall'] == "0") { echo "양호"; } else { echo "불량";}?></td>
		</tr>
		<tr>
		<th>간판 유지 관리상태</th>
		<td><?php if($view['vi_sign'] == "0") { echo "양호"; } else { echo "불량";}?></td>
		</tr>
		<tr>
		<th>쇼 윈도우 및 사인물<br />유지 관리상태</th>
		<td><?php if($view['vi_show'] == "0") { echo "양호"; } else { echo "불량";}?></td>
		</tr>
		<tr>
		<th>카운터 및 주방<br />유지 관리상태</th>
		<td><?php if($view['vi_cash'] == "0") { echo "양호"; } else { echo "불량";}?></td>
		</tr>
		<tr>
		<th>유니폼 착용 유무</th>
		<td><?php if($view['vi_uni'] == "0") { echo "유"; } else { echo "무";}?></td>
		</tr>
		<tr>
		<th colspan="2" style="text-align:center">내용</th>
		</tr>
		<tr>
		<td colspan="2"><?php echo nl2br($view['vi_content'])?></td>
		</tr>
		</table>
		<br />
		<p>점주 확인 : <b><?php echo $view['vi_confirm']?></b> 인(서명)</p>

	<img src="<?php echo "img_sign/".$view['j_data']?>" style="width:90%"/>
	</div>
	<img src="./img_btn/save_btn.gif" class="vi_update" style="cursor:pointer" />
	<img src="./img_btn/list_btn.gif" class="vi_list" style="cursor:pointer" />
	<img src="./img_btn/delete_btn.gif" class="vi_dele" style="cursor:pointer" />
	<br />
</div>
<br />
<script>

$(".vi_update").click(function() {
	location.href = "<?php echo $g4['path']?>adm/adm_new/m_visit_insert.php?bo_table=visit&w=u&id=<?php echo $view['id']?>";
});

$(".vi_list").click(function() {
	location.href = "<?php echo ""?>/adm/adm_new/m_visit_list.php?bo_table=visit";
});
/*
$(".vi_dele").click(function() {
	location.replace("<?php echo $g4['path']?>/adm/m_visit_update.php?w=d&id=<?php echo $view['id']?>");
});
*/
</script>

<?
include_once("../admin.tail.php");
?>
